package main

import "fmt"

func test(a int, b int) int {
	defer fmt.Println("defer 变量a的值：", a)
	defer fmt.Println("defer 变量b的值：", b)
	//操作变量
	a += 100
	b += 100
	c := a + b
	fmt.Println("函数计算结果：", c)
	return c
}

/**
  测试defer
*/
func main() {
	res := test(1, 2)
	fmt.Println("main调用执行结果：", res)
}
